﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace Manager.Model.Admin
{
    /// <summary>
    /// M_Admin:实体类(属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]
    public partial class M_Admin
    {
        public M_Admin()
        { }
        #region Model
        private int _userid;
        private string _username;
        private string _password;
        private string _realname;
        private string _email;
        private int? _roleid = 0;
        /// <summary>
        /// 
        /// </summary>
        [Display(Name="管理员编号")]
        public int UserId
        {
            set { _userid = value; }
            get { return _userid; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Display(Name="用户名")]
        [Required]
        [StringLength(20)]
        public string Username
        {
            set { _username = value; }
            get { return _username; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Display(Name="密码")]
        [Required]
        [StringLength(32)]
        public string Password
        {
            set { _password = value; }
            get { return _password; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Display(Name = "真实姓名")]
        [Required]
        [StringLength(20)]
        public string Realname
        {
            set { _realname = value; }
            get { return _realname; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Display(Name = "邮箱")]
        [StringLength(40)]
        [RegularExpression(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "请输入正确的邮箱地址")]
        public string Email
        {
            set { _email = value; }
            get { return _email; }
        }
        /// <summary>
        /// 
        /// </summary>
        [Display(Name="角色")]
        [Required]
        public int? RoleID
        {
            set { _roleid = value; }
            get { return _roleid; }
        }
        #endregion Model

    }
}